#25 new
Michael Hartl

Some model names (such as 'person') are pluralized incorrectly

Reported by Michael Hartl | November 3rd, 2008 @ 06:09 PM

The plugin handles 'person' and some other irregular words incorrectly. For example,

script/generate authenticated person sessions

gives code like


map.signup '/signup', :controller => 'peoples', :action => 'new'

instead of


map.signup '/signup', :controller => 'people', :action => 'new'

(i.e., 'peoples' instead of 'people').

What's happening is that, implicitly, pluralize is being called twice on the model name, so the plugin fails for any name that doesn't satisfy the identity


name.pluralize.pluralize == name.pluralize

In the example, the problem is that 'person'.pluralize == 'people' but 'people'.pluralize == 'peoples'.

The culprit is in the call to inflect_names in authenticated_generator.rb. I've attached a patch with a fix; let me know if you'd prefer a GitHub pull request.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Restful Authentication Generator

This widely-used plugin provides a foundation for securely managing user
authentication:
* Login / logout
* Secure password handling
* Account activation by validating email
* Account approval / disabling by admin
* Rudimentary hooks for authorization and access control.

http://github.com/technoweenie/restful-authentication/tree

People watching this ticket

Tags

Pages